package com.shycloud.mido.organ.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.organ.api.dto.StudentDTO;
import com.shycloud.mido.organ.api.dto.StudentDetailedDTO;
import com.shycloud.mido.organ.api.entity.StudentDetailedEntity;
import com.shycloud.mido.organ.api.vo.OrganVO;
import com.shycloud.mido.organ.api.vo.StudentDetailVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 学生详情
 *
 * @author yyy
 * @date 2019-09-24 10:06:58
 */
public interface StudentDetailedMapper extends BaseMapper<StudentDetailedEntity> {

    /**
     * @author: Cxc
     * @Date: 2019/9/24 20:21
     * @Description: 学生列表一览
     */
    IPage selectStudentList(@Param("page") Page page, @Param("entity") StudentDTO entity);

    /**
     * @author: Cxc
     * @Date: 2019/9/25 16:12
     * @Description: 新增学员平台验证
     */
    StudentDTO selectStudentByPhone(StudentDTO studentDTO);

    /**
     * 会员所在机构
     *
     * @param memberId 会员ID
     * @param status   身份 0 学生 1教师
     * @return
     */
    List<OrganVO> organByMemberId(@Param("memberId") String memberId, @Param("status") String status);

    /**
     * 机构学生列表
     *
     * @param orgId    机构ID
     * @param memberId 会员ID
     * @return
     */
    List<StudentDetailedEntity> organStudentList(@Param("orgId") String orgId, @Param("memberId") String memberId);

    /**
     * 未上课机构学生列表
     *
     * @param orgId    机构ID
     * @param memberId 会员ID
     * @return
     */
    List<StudentDetailedEntity> classStudentList(@Param("orgId") String orgId, @Param("memberId") String memberId);

    /**
     * @author: Whfeng
     * @Date: 2019-10-10 17:46
     * @Description: 未分配学生查询
     */
    IPage selectUnallocatedStudentList(Page page, @Param("entity") StudentDTO entity);

    /**
     * @author: Whfeng
     * @Date: 2019-10-11 14:07
     * @Description: 教师查询学生列表
     */
    List<StudentDTO> selectTeacherHaveStudentList(@Param("entity") StudentDetailedEntity studentDetailedEntity);

	/**
	 * @author: nianhua.jiang
	 * @Date: 2020-03-23 14:07
	 * @Description: 教师查询学生列表
	 */
	List<StudentDTO> selectTeacherHaveStudentListAndTask(@Param("entity") StudentDetailedEntity studentDetailedEntity);

	/**
	 * @author: cxc
	 * @Date: 2019-10-11 14:07
	 * @Description: 根据老师查询学生
	 */
	List<StudentDTO> selectTeacherOrgIdList(@Param("entity") StudentDetailedEntity studentDetailedEntity);

    /**
     * @author: Whfeng
     * @Date: 2019-10-11 15:40
     * @Description: 学生基本信息
     */
    StudentDTO selectStudentDetail(@Param("entity") StudentDetailedEntity studentDetailedEntity);

    /**
     * @author: Whfeng
     * @Date: 2019-10-12 13:09
     * @Description: 学生课程信息查询
     */
    List<StudentDTO> selectStudentCourseById(@Param("entity") StudentDetailedEntity studentDetailedEntity);

	/**
	 * @author: Cxc
	 * @Date: 2019/10/15 14:45
	 * @Description: 根据学生id 查出学生对应老师
	 */
	List<StudentDTO> selectTeacherList(@Param("entity") StudentDTO studentDTO);

	/**
	 * 查询学生列表
	 * @param teacherId 教师ID
	 * @return
	 */
	List<StudentDetailedDTO> selectStudentByTeacherId(@Param("teacherId")String teacherId,@Param("name")String name);

	/**
	 * 根据课程类型查询此学生的剩余订单数
	 * @author nianhua.jiang
	 * @date 2020/4/3 10:59
	 * @param studentId
	 * @param orgId
	 * @param type
	 * @return int
	*/
	Integer selectTypeSum(@Param("studentId") String studentId, @Param("orgId") Integer orgId, @Param("type") String type);

	/**
	 * 获取学生信息
	 * @author nianhua.jiang
	 * @date 2020/4/14 17:38
	 * @param studentId
	 * @return com.shycloud.mido.organ.api.vo.StudentDetailVO
	*/
	StudentDetailVO getStudentDetail(@Param("studentId") String studentId);
}
